﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAO;
using DTO;
namespace BUS
{
    public class BUS_LoaiKM
    {
        private DAO_LoaiKM dao;

        public BUS_LoaiKM()
        {
            dao = new DAO_LoaiKM();
        }
        public List<string> selectALl()
        {
            List<string> list = new List<string>();
            List<DTO_LoaiKM> danhsach = dao.SelectAllLoaiKM();
            for (int i = 0; i < danhsach.Count; i++)
            {
                list.Add(danhsach[i].TenLoai);
            }
            return list;
        }
        public string layTenLoai(int maloai)
        {
            List<DTO_LoaiKM> danhsach = dao.LayTenLoai(maloai);
            if (danhsach.Count > 0)
                return danhsach[0].TenLoai;
            return null;
        }
    }
}
